#include <windows.h>

#define LineX 0xffffffcd
#define LineY 0xffffffba
#define Line1 0xffffffc9
#define Line2 0xffffffbb
#define Line3 0xffffffbc
#define Line4 0xffffffc8
#define BlockChar 0xffffffdb

#define MainMenuStartY 14

#define MenuSize 6
#define MaxMenuLength 15
#define ActiveStringsLength 2
#define EasterStringsLength 2
#define SearchClientLength 3
#define DemandClientLength 5
#define ClientFieldsLength 9
#define ReportsStringsLength 6
#define SortClientDemandFieldsLength 3
#define PropertiesStringsLength 6
#define DPKindLength 3
#define PropertiesFieldsLength 10
#define MathingStringsLength 3
#define SPEC_S ".@/$&*() "
#define abc_S "abcdefghijklmnopqrstuvwxyz"
#define ABC_S "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
#define NUM_S "0123456789"
#define TEXT_S abc_S ABC_S SPEC_S NUM_S 

#define EASTER "admin"
#define ClientsFile "Clients.dat"
#define PropertiesFile "Properties.dat"

const char *mainstrings[MenuSize];
const char *clientstrings[MenuSize];
const char *clientfieldstrings[ClientFieldsLength];
const char *ActiveStrings[ActiveStringsLength];
const char *GenderStrings[ActiveStringsLength];
const char *EasterStrings[EasterStringsLength];
const char *SearchClientStrings[SearchClientLength];
const char *DemandClientStrings[DemandClientLength];
const char *DPKindStrings[DPKindLength];
const char *DPDemandTypeStrings[ActiveStringsLength];
const char *DemandEditStrings[ActiveStringsLength];
const char *ReportsStrings[ReportsStringsLength];
const char *SortClientDemandFields[SortClientDemandFieldsLength];
const char *PropertiesStrings[PropertiesStringsLength];
const char *DPPropertyTypeStrings[ActiveStringsLength];
const char *PropertiesFields[PropertiesFieldsLength];
const char *PropertiesFieldsSearch[ActiveStringsLength];
const char *MatchingStrings[MathingStringsLength];


void DeleteClientsFile();
void DeletePropertiesFile();

int getmaxmenulength(const char *A[],int);
void placemenu(const char *Arr[],int,int,int,char *,int);

void GrayScreen(int C);
void fadeonquit();
void gotoxy(int,int);
void settextcolor(int);
void setbackgroundcolor(char *clr);
void showcursor(BOOL a);
void clrscr();
void box(int,int,int,int);
int menu_old(const char *Arr[],int size,int starti,char *Header,int startY);
int menu(const char *Arr[],int size,int starti,char *Header,int StartY);
byte menu_hor(const char *Arr[],int size,int starti,char *Header,int StartX);
char *readvalue(char *title,char *range,int masked,int maxsize,char *msg);
void plotasciiimage(unsigned char Arr[],int x0,int y0,int sizex,int sizey,int min_x,int max_x);
void showmainmenu(int flag);
void showinputimage(int flag);
void showoutputimage(int flag);
void printman(int x,int y);
void printwoman(int x,int y);

void fillascii(int x0,int y0,int x1,int y1,char chr,char clr);
void puttext(char *str,int x,int y,int clr,int mid,int delsize);
void putnumber(int num,int x,int y,int clr,int mid,int delsize,char *c1,char *c2);

int AskYesNoQuestion(char *Question);
void ConfirmationMessage(char *Message);

int CheckPassword(char *msg);
int UserCheckPassword();
int GetBitCount(char ch);

void PutFontNumber(int x,int y,char *num,int P);

CHAR_INFO* PushScreen();
void PopScreen(CHAR_INFO *INFO);

void fadetoscreen(CHAR_INFO *s1);
void MainMenuFadeCallBack();
DWORD WINAPI StartThread(LPVOID iValue);
